CPP = g++
CFLAGS = -Wall -O3
LIB =  -lgsl -lgslcblas

OBJ = main.o input_data.o sampler.o table.o
all: phasing

phasing: $(OBJ)
	$(CPP) $(CFLAGS) -o phasing $(OBJ) $(LIB)

phasing.o: main.cpp sampler.cpp table.cpp

input_data.o: input_data.cpp input_data.h util.h typedefs.h basic_includes.h Makefile
	$(CPP) $(CFLAGS) -c -o input_data.o input_data.cpp

main.o: main.cpp sampler.h input_data.h util.h typedefs.h basic_includes.h Makefile
	$(CPP) $(CFLAGS) -c -o main.o main.cpp

sampler.o: sampler.cpp sampler.h input_data.h table.h util.h typedefs.h basic_includes.h
	$(CPP) $(CFLAGS) -c -o sampler.o sampler.cpp

table.o: table.h util.h typedefs.h basic_includes.h
	$(CPP) $(CFLAGS) -c -o table.o table.cpp

clean:
	rm *.o phasing
